Page History: Markets
Compare Page Revisions
Page Revision: 2012/01/23 10:39
The Markets property on the MarketData object contains all the markets that have been loaded. It does not contain all the available markets.
The Market object provides the details of a single market, and allows quotes to be obtained. The properties and methods are described
here.
To obtain quotes for a market you must subscribe to it using the
DepthSubscribe method:
' Subscribe to the market.
oMarket.DepthSubscribe(DepthBuffer.Smart, DepthLevels.Normal)
The parameters are as follows:
Buffer | The buffering that should be applied. Smart is the default and is the recommended buffering setting: DepthBuffer |
Levels | The amount of depth that is required. Normal is the default and provides 10 lines of depth: DepthLevels |
In order to maintain the correct subscription level then you must handle the
MarketCheckSubscription event. If you unsubscribe from a market, or if the API itself changes the subscription level when calculating P&L, then the market will raise a MarketCheckSubscription event to check to see if there is anything else in your application that still needs the subscription. An example of how to handle this event is shown below:
FORMATTER ERROR (Snippet Not Found)
FORMATTER ERROR (Snippet Not Found) moMarket_MarketCheckSubscription(FORMATTER ERROR (Snippet Not Found) poMarket FORMATTER ERROR (Snippet Not Found) Market, FORMATTER ERROR (Snippet Not Found) penDepthBuffer FORMATTER ERROR (Snippet Not Found) DepthBuffer, FORMATTER ERROR (Snippet Not Found) penDepthLevels FORMATTER ERROR (Snippet Not Found) DepthLevels) FORMATTER ERROR (Snippet Not Found) moMarket.MarketCheckSubscription
:
penDepthBuffer = poMarket.DepthSubscribeAtLeast(DepthBuffer.Smart, penDepthBuffer)
penDepthLevels = poMarket.DepthSubscribeAtLeast(DepthLevels.All, penDepthLevels)
:
FORMATTER ERROR (Snippet Not Found)